//
//  CZHChangeNullString.m
//  GeeCityManager
//
//  Created by 聚城科技 on 16/4/13.
//  Copyright © 2016年 聚城科技. All rights reserved.
//

#import "CZHChangeNullString.h"

@implementation CZHChangeNullString


#pragma mark 将字典里的null 转换为空字符
+ (NSDictionary *)getValueFromDictionary:(NSDictionary *)dic
{
    NSMutableDictionary *valueDic = [[NSMutableDictionary alloc] init];
    NSArray *keyArray = [dic allKeys];
    NSMutableArray *valueS = [[NSMutableArray alloc] init];
    for (int i = 0; i < keyArray.count; i ++) {
        NSString *key = [keyArray objectAtIndex:i];
        NSString *value = [NSString stringWithFormat:@"%@",[dic objectForKey:key]];
        if ([value isEqualToString:@"null"] ||  [value isEqualToString:@"<null>"] || [value isEqualToString:@"(null)"]) {
            value = @"";
        }
        [valueS addObject:value];
        [valueDic setObject:value forKey:key];
    }
    return valueDic;
}

@end
